﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="grossprofit.aspx.cs" Inherits="PeisongWeb.admin.grossprofit" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>系统毛利分析 - 想购网采购配送系统</title>

    <script language="javascript">
        //        var today, theday;
        //        today = new Date();
        //        theday = today.getFullYear() + "-" + [today.getMonth() + 1] + "-" + today.getDate();
        function resetPro() {
            document.getElementById("ext_StartInputDt").value = "";
            document.getElementById("ext_EndInputDt").value = "";
            document.getElementById("txt_productName").value = "";
            document.getElementById("txt_buyer").value = "";
            document.getElementById("txt_seller").value = "";
        }
        function resetCategory() {
            document.getElementById("ext_StartInputDt2").value = "";
            document.getElementById("ext_EndInputDt2").value = "";
            document.getElementById("txtBuyer").value = "";
            document.getElementById("txtSeller").value = "";
        }
    </script>

    <!--#include file="style.inc"-->
</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            系统毛利分析
        </h2>
        <ext:Panel ID="Panel2" runat="server" Title="分析毛利" BodyStyle="padding:5px 5px 0"
            Width="1024" Frame="true" ButtonAlign="Center">
            <Body>
                <ext:Panel ID="Panel3" runat="server">
                    <Body>
                        <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" BodyStyle="0px;" Plain="true">
                            <Tabs>
                                <ext:Tab ID="Tab1" runat="server" Title="按小类查看" AutoHeight="true" Frame="true">
                                    <Body>
                                        <ext:ColumnLayout ID="ColumnLayout1" runat="server">
                                            <ext:LayoutColumn ColumnWidth=".5">
                                                <ext:Panel ID="Panel4" runat="server" Border="false" Header="false">
                                                    <Body>
                                                        <div id="admin_edit_content_search" style="padding-top: 10px; padding-bottom: 25px;
                                                            background-color: #DFE8F6"">
                                                            <ul>
                                                                <li style="width: 162px">
                                                                    <label>
                                                                        下单日期</label>
                                                                    <ext:DateField ID="ext_StartInputDt2" runat="server" AllowBlank="true" ReadOnly="true"
                                                                        Width="100px" />
                                                                </li>
                                                                <li style="width: 160px;">
                                                                    <label style="width: 25px">
                                                                        至
                                                                    </label>
                                                                    <ext:DateField ID="ext_EndInputDt2" ReadOnly="true" runat="server" Width="100px" />
                                                                </li>
                                                                <li style="width: auto; margin-right: 10px">
                                                                    <label>
                                                                        采购企业
                                                                    </label>
                                                                    <asp:TextBox runat="server" ID="txtBuyer"></asp:TextBox>
                                                                </li>
                                                                <li style="width: auto; margin-right: 10px">
                                                                    <label>
                                                                        供应商
                                                                    </label>
                                                                    <asp:TextBox runat="server" ID="txtSeller"></asp:TextBox>
                                                                </li>
                                                                <li style="width: auto;">[<asp:LinkButton ID="lbtn_Search2" runat="server" Text="搜 索"
                                                                    OnClick="lbtn_Search2_Click" CausesValidation="false">
                                                                </asp:LinkButton>] &nbsp;&nbsp;&nbsp; [<a href="javascript:resetCategory();">重 置</a>]
                                                                    <span style="<%=power>=2?"": "display:none" %>">
                                                                        <asp:LinkButton ID="lbn_ImportByC" runat="server" Text="［导出 Excel］" CausesValidation="false"
                                                                            OnClick="lbn_ImportByC_Click">
                                                                        </asp:LinkButton>
                                                                    </span></li>
                                                            </ul>
                                                        </div>
                                                        <div id="admin_list_content" style="width: 1000px">
                                                            <table cellpadding="0" cellspacing="0">
                                                                <tr class="header-row">
                                                                    <th>
                                                                        大类
                                                                    </th>
                                                                    <th>
                                                                        小类
                                                                    </th>
                                                                    <th>
                                                                        平均进价
                                                                    </th>
                                                                    <th>
                                                                        供应商
                                                                    </th>
                                                                    <th>
                                                                        平均出价
                                                                    </th>
                                                                    <th>
                                                                        采购商
                                                                    </th>
                                                                    <th>
                                                                        平均毛利
                                                                    </th>
                                                                    <th>
                                                                        平均毛利率
                                                                    </th>
                                                                </tr>
                                                                <asp:Repeater ID="rptCategory_list" runat="server">
                                                                    <ItemTemplate>
                                                                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                                                                            <td width="5%" height="26" align="center">
                                                                                <%# Eval("categoryParent")%>
                                                                            </td>
                                                                            <td width="5%" height="26" align="center">
                                                                                <%# Eval("category")%>
                                                                            </td>
                                                                            <td width="5%" height="26" align="center">
                                                                                <%#string.Format("{0:F2}", Eval("sellerPrice"))%>
                                                                            </td>
                                                                            <td width="5%" height="26" align="center">
                                                                                <%# Eval("sellerName")%>
                                                                            </td>
                                                                            <td width="5%" height="26" align="center">
                                                                                <%#string.Format("{0:F2}", Eval("price"))%>
                                                                            </td>
                                                                            <td width="15%" height="26" align="center">
                                                                                <%# Eval("company")%>
                                                                            </td>
                                                                            <td width="5%" height="26" align="center">
                                                                                <%#string.Format("{0:F2}", Eval("profits"))%>
                                                                            </td>
                                                                            <td width="5%" height="26" align="center">
                                                                                <%#string.Format("{0:F2}", Eval("rates"))%>%
                                                                            </td>
                                                                        </tr>
                                                                    </ItemTemplate>
                                                                </asp:Repeater>
                                                            </table>
                                                            <div id="page">
                                                                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                                                                    OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                                                                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                                                                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                                                                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                                                                    LastPageText="末页" PrevPageText="上一页">
                                                                </webdiyer:AspNetPager>
                                                            </div>
                                                            <table cellpadding="0" cellspacing="0">
                                                                <tr align="center" style="height: 20px; background-color: #C0D5F0">
                                                                    <td bgcolor="#C0D5F0">
                                                                    </td>
                                                                    <td bgcolor="#C0D5F0">
                                                                        总供应量
                                                                    </td>
                                                                    <td bgcolor="#C0D5F0">
                                                                        总订购量
                                                                    </td>
                                                                </tr>
                                                                <tr align="center" style="height: 20px; background-color: #C0D5F0">
                                                                    <td bgcolor="#FFFFFF">
                                                                        合&nbsp;&nbsp;计
                                                                    </td>
                                                                    <td bgcolor="#FFFFFF">
                                                                        ￥<asp:Label runat="server" CssClass="red" ID="Label1"></asp:Label>
                                                                        &nbsp;
                                                                    </td>
                                                                    <td bgcolor="#FFFFFF">
                                                                        ￥<asp:Label runat="server" CssClass="red" ID="Label2"></asp:Label>
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                    </Body>
                                                </ext:Panel>
                                            </ext:LayoutColumn>
                                        </ext:ColumnLayout>
                                    </Body>
                                </ext:Tab>
                                <ext:Tab ID="Tab2" runat="server" Title="按商品查看" AutoHeight="true" Frame="true">
                                    <Body>
                                        <div id="admin_edit_content_search" style="padding-top: 10px; padding-bottom: 50px;
                                            background-color: #DFE8F6">
                                            <ul>
                                                <li style="width: 162px">
                                                    <label>
                                                        下单日期</label>
                                                    <ext:DateField ID="ext_StartInputDt" runat="server" AllowBlank="true" ReadOnly="true"
                                                        Width="100px" />
                                                </li>
                                                <li style="width: 162px;">
                                                    <label style="width: 25px">
                                                        至
                                                    </label>
                                                    <ext:DateField ID="ext_EndInputDt" ReadOnly="true" runat="server" Width="100px" />
                                                </li>
                                                <li style="width: 600px; margin-right: 10px">
                                                    <label>
                                                        商品名称
                                                    </label>
                                                    <asp:TextBox runat="server" ID="txt_productName"></asp:TextBox>
                                                </li>
                                                <li style="width: auto; margin-right: 120px">
                                                    <label>
                                                        采购企业
                                                    </label>
                                                    <asp:TextBox runat="server" ID="txt_buyer"></asp:TextBox>
                                                </li>
                                                <li style="width: auto; margin-right: 20px">
                                                    <label>
                                                        供 应 商
                                                    </label>
                                                    <asp:TextBox runat="server" ID="txt_seller"></asp:TextBox>
                                                </li>
                                                <li>[<asp:LinkButton ID="LinkButton1" runat="server" Text="搜 索" OnClick="lbtn_Search_Click"
                                                    CausesValidation="false">
                                                </asp:LinkButton>] &nbsp;&nbsp;&nbsp; [<a href="javascript:resetPro();">重 置</a>] <span
                                                    style="<%=power>=2?"": "display:none" %>">
                                                    <asp:LinkButton ID="lbn_Import" runat="server" Text="［导出 Excel］" CausesValidation="false"
                                                        OnClick="lbn_Import_Click">
                                                    </asp:LinkButton>
                                                </span></li>
                                            </ul>
                                        </div>
                                        <div id="admin_list_content" style="width: 1000px">
                                            <table cellpadding="0" cellspacing="0">
                                                <tr class="header-row">
                                                    <th>
                                                        商品名称
                                                    </th>
                                                    <th>
                                                        平均进价
                                                    </th>
                                                    <th>
                                                        供应商
                                                    </th>
                                                    <th>
                                                        平均出价
                                                    </th>
                                                    <th>
                                                        采购商
                                                    </th>
                                                    <th>
                                                        平均毛利
                                                    </th>
                                                    <th>
                                                        平均毛利率
                                                    </th>
                                                </tr>
                                                <asp:Repeater ID="rpt_list" runat="server">
                                                    <ItemTemplate>
                                                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>' style='<%#Convert.ToDecimal(Eval("profits")) < 0 ? "color:#4A9D49": ""%>'>
                                                            <td width="5%" height="26" align="center">
                                                                <%# Eval("proName")%>
                                                            </td>
                                                            <td width="5%" height="26" align="center">
                                                                <asp:Literal runat="server" ID="lblsellerPrice" Text='<%#String.Format("{0:F2}",Eval("sellerPrice"))%>'>
                                                                </asp:Literal>
                                                            </td>
                                                            <td width="5%" height="26" align="center">
                                                                <%# Eval("sellerName")%>
                                                            </td>
                                                            <td width="5%" height="26" align="center">
                                                                <asp:Literal runat="server" ID="lblprice" Text='<%#String.Format("{0:F2}",Eval("price"))%>'>
                                                                </asp:Literal>
                                                            </td>
                                                            <td width="15%" height="26" align="center">
                                                                <%# Eval("company")%>
                                                            </td>
                                                            <td width="5%" height="26" align="center">
                                                                <%#string.Format("{0:F2}", Eval("profits"))%>
                                                            </td>
                                                            <td width="5%" height="26" align="center">
                                                                <%#string.Format("{0:F2}", Eval("rates"))%>%
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>
                                                </asp:Repeater>
                                                <%--<tr align="center" style="height: 20px; background-color: #C0D5F0">
                                                    <td bgcolor="#C0D5F0">
                                                        当前页汇总
                                                    </td>
                                                    <td bgcolor="#FFFFFF">
                                                        ￥<asp:Label runat="server" CssClass="red" ID="lbl_sellerPriceSum"></asp:Label>
                                                        &nbsp;
                                                    </td>
                                                    <td bgcolor="#C0D5F0">
                                                        &nbsp;&nbsp;
                                                    </td>
                                                    <td bgcolor="#FFFFFF">
                                                        ￥<asp:Label runat="server" CssClass="red" ID="lbl_priceSum"></asp:Label>
                                                        &nbsp;
                                                    </td>
                                                    <td bgcolor="#C0D5F0" colspan="3">
                                                        &nbsp;&nbsp;
                                                    </td>
                                                </tr>--%>
                                            </table>
                                            <div id="page">
                                                <webdiyer:AspNetPager ID="AspNetPager2" NumericButtonType="Text" MoreButtonType="Text"
                                                    OnPageChanged="AspNetPager2_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                                                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                                                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                                                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                                                    LastPageText="末页" PrevPageText="上一页">
                                                </webdiyer:AspNetPager>
                                            </div>
                                            <table cellpadding="0" cellspacing="0">
                                                <tr align="center" style="height: 20px; background-color: #C0D5F0">
                                                    <td bgcolor="#C0D5F0">
                                                    </td>
                                                    <td bgcolor="#C0D5F0">
                                                        总供应量
                                                    </td>
                                                    <td bgcolor="#C0D5F0">
                                                        总订购量
                                                    </td>
                                                </tr>
                                                <tr align="center" style="height: 20px; background-color: #C0D5F0">
                                                    <td bgcolor="#FFFFFF">
                                                        合&nbsp;&nbsp;计
                                                    </td>
                                                    <td bgcolor="#FFFFFF">
                                                        ￥<asp:Label runat="server" CssClass="red" ID="lbl_sellerPriceTotal"></asp:Label>
                                                        &nbsp;
                                                    </td>
                                                    <td bgcolor="#FFFFFF">
                                                        ￥<asp:Label runat="server" CssClass="red" ID="lbl_priceTotal"></asp:Label>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </Body>
                                </ext:Tab>
                            </Tabs>
                        </ext:TabPanel>
                    </Body>
                </ext:Panel>
            </Body>
        </ext:Panel>
    </div>
    </form>
</body>
</html>
